/*
 * 人人信用管理有限公司版权所有.
 * 
 * @Description:
 * 
 * @author: liyuliang
 * 
 * @date: 20 Apr 2017 10:44:16 am
 * 
 * 注意：本内容仅限于人人信用管理有限公司内部传阅，禁止外泄以及用于其他的商业目的.
 */

package com.rrx360.common.web.bean;

import java.util.HashMap;
import java.util.Map;

public class RxResult {

  public static final RxResult EMPTY = new RxResult();

  private String rstCode;

  private String rstInfo;

  private Object data;

  private Long count;

  private Map<String, Object> ctx;

  private RxErrors errors = new RxErrors();

  public RxResult() {

  }

  public RxResult(String rstCode, String rstInfo) {
    this.rstCode = rstCode;
    this.rstInfo = rstInfo;
  }

  public RxResult(Long count, Object data) {
    this.count = count;
    this.data = data;
  }


  public Object getData() {
    return data;
  }

  public void setData(Object data) {
    this.data = data;
  }

  public Long getCount() {
    return count;
  }

  public void setCount(Long count) {
    this.count = count;
  }

  public Map<String, Object> getCtx() {
    return ctx;
  }

  public void setCtx(Map<String, Object> ctx) {
    this.ctx = ctx;
  }

  public void putCtxData(String key, String value) {
    if (ctx == null) {
      ctx = new HashMap<String, Object>();
    }
    ctx.put(key, value);
  }

  public RxErrors getErrors() {
    return errors;
  }

  public void setErrors(RxErrors errors) {
    this.errors = errors;
  }

  public void addError(String field, String msg) {
    if (this.errors == null) {
      this.errors = new RxErrors();
    }
    this.errors.addError(field, msg);
  }

  public String getRstCode() {
    return rstCode;
  }

  public void setRstCode(String rstCode) {
    this.rstCode = rstCode;
  }

  public String getRstInfo() {
    return rstInfo;
  }

  public void setRstInfo(String rstInfo) {
    this.rstInfo = rstInfo;
  }



}
